#include "FWCamera.h"
#define CENTER_H 255
#define CENTER_V 250
#define LOOK 550
#define TOP 480

FWCamera::FWCamera(void)
{
}
FWCamera::FWCamera(float left, float right, float bottom)
{

	_vp_y = bottom;
	//tao ma
	D3DXMatrixIdentity(&this->_matrixI4);
	this->_matrixI4._22 = -1;
	this->_vp_x = left;
}
void FWCamera:: update(D3DXVECTOR2 target)
{
	if(target.x > CENTER_V)
	{
		this->_vp_x = target.x -CENTER_V;
	}
}
D3DXMATRIX* FWCamera :: getTransformedMatrix()
{
	D3DXMATRIX transformMatrix;
	D3DXMatrixTranslation(&transformMatrix, -this->_vp_x,this->_vp_y,0);
	D3DXMatrixMultiply(&this->_transform,&this->_matrixI4,&transformMatrix);
	return &this->_transform;
}
FWCamera::~FWCamera(void)
{
}
